package classcourse.servlet;



import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import entity.classCourse;
import classcourse.classCourseDaoImpl;

/**
 * Servlet implementation class updateCourse
 */
@WebServlet("/updateClassCourse")
public class updateClassCourse extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public updateClassCourse() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("UTF-8");
		response.setCharacterEncoding("UTF-8");
		response.setContentType("text/html;charset=utf-8");

		String id=request.getParameter("id");
		String classcoursename=request.getParameter("classcoursename");
		String date=request.getParameter("date");
		
		classCourseDaoImpl h1=new classCourseDaoImpl();		
		h1.updateclassCourse(id,classcoursename,date);
//		request.getRequestDispatcher("TeacherIndex.jsp").forward(request, response);
	response.getWriter().write("<script>alert('�޸ĳɹ�!');window.location.href='HeaderTeacher.jsp'</script>");
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
